package com.leiqichao.backend.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("comments")
public class Comment {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField("article_id") private Long articleId;
    @TableField("parent_id") private Long parentId;
    @TableField("author_name") private String authorName;
    @TableField("author_email") private String authorEmail;
    @TableField("content") private String content;
    @TableField("status") private String status; // pending/approved/spam/trash
    @TableField("ip_address") private String ipAddress;
    @TableField("user_agent") private String userAgent;
    @TableLogic @TableField("is_deleted") private Boolean isDeleted = false;
    @TableField(value = "created_at", fill = FieldFill.INSERT) private LocalDateTime createdAt;
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE) private LocalDateTime updatedAt;
}